<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../../assets/css/base.css">
  <style>
    .flex-container {
      display: flex;
      /*
        align-items 交叉轴方向 子元素在行内的对齐方式 在父元素上设置该属性
         ● center
         ● start
         ● end
         ● flex-start
         ● flex-end
         ● stretch
       */
      align-items: center;
      width: 300px;
      height: 300px;
      border: 1px solid black;
    }

    .flex-container>div {
      width: 100px;
      height: 100px;
    }

    .flex-container>div:nth-child(1) {
      background-color: red;
    }

    .flex-container>div:nth-child(2) {
      background-color: orange;
    }

    .flex-container>div:nth-child(3) {
      background-color: yellow;
    }

    .start {
      align-items: start;
    }

    .center {
      align-items: center;
    }

    .end {
      align-items: end;
    }

    .stretch {
      align-items: stretch;
    }

    .stretch>div {
      height: auto;
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10">
    <p class="title">start</p>
    <div class="flex-container start">
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">center</p>
    <div class="flex-container center">
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">end</p>
    <div class="flex-container end">
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">stretch</p>
    <div class="flex-container stretch">
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>
</body>

</html>